/**
 * @author: jw
 */

/**
 * @description 登录
 */
export const login = {
  name: "登录",
  url: "/login",
  method: "post",
  requestDemo: {
    username: "admin",
    password: ""
  },
  responseDemo: {
    code: 1,
    message: "SUCCESS",
    data: {
      user: {
        id: "1",
        remark: null,
        createTime: "2020-06-21 16:38:01",
        updateTime: "2020-06-21 16:38:01",
        createUser: "1",
        createUsername: null,
        updateUser: null,
        updateUsername: null,
        roleId: "1",
        departId: "2",
        username: "admin",
        name: "系统管理员",
        gender: "male",
        phone: "18989898899",
        mail: "emd@qq.com",
        status: "ENABLED",
        departName: "系统管理",
        roleName: "系统管理员",
        parentDepartId: "1",
        parentDepartName: "煤矿数据系统",
        genderValue: "男",
        statusValue: "启用"
      },
      permissions: [
        {
          id: "11",
          remark: null,
          createTime: "2020-06-22 13:59:22",
          updateTime: "2020-06-22 13:59:24",
          createUser: null,
          createUsername: null,
          updateUser: null,
          updateUsername: null,
          parentId: "-1",
          code: "User",
          name: "用户管理",
          url: "/sys/user",
          sign: "user",
          required: false,
          type: "menu",
          orderNum: 11,
          icon: null,
          roleId: "1",
          showFlag: false,
          childList: []
        },
        {
          id: "12",
          remark: null,
          createTime: "2020-06-22 14:00:30",
          updateTime: "2020-06-22 14:00:32",
          createUser: null,
          createUsername: null,
          updateUser: null,
          updateUsername: null,
          parentId: "-1",
          code: "Role",
          name: "角色管理",
          url: "/sys/role",
          sign: "role",
          required: false,
          type: "menu",
          orderNum: 12,
          icon: null,
          roleId: "1",
          showFlag: false,
          childList: []
        },
        {
          id: "13",
          remark: null,
          createTime: "2020-06-22 14:39:02",
          updateTime: "2020-06-22 14:39:04",
          createUser: null,
          createUsername: null,
          updateUser: null,
          updateUsername: null,
          parentId: "-1",
          code: "Department ",
          name: "组织管理",
          url: "/sys/organization",
          sign: "depart",
          required: false,
          type: "menu",
          orderNum: 13,
          icon: null,
          roleId: "1",
          showFlag: false,
          childList: []
        },
        {
          id: "14",
          remark: null,
          createTime: "2020-06-22 14:39:02",
          updateTime: "2020-06-22 14:39:04",
          createUser: null,
          createUsername: null,
          updateUser: null,
          updateUsername: null,
          parentId: "-1",
          code: "Menu",
          name: "菜单管理",
          url: "/sys/menu",
          sign: "perm",
          required: false,
          type: "menu",
          orderNum: 14,
          icon: null,
          roleId: "1",
          showFlag: false,
          childList: []
        },
        {
          id: "16",
          remark: null,
          createTime: "2020-06-22 14:39:02",
          updateTime: "2020-06-22 14:39:04",
          createUser: null,
          createUsername: null,
          updateUser: null,
          updateUsername: null,
          parentId: "-1",
          code: "Log",
          name: "日志管理",
          url: "/sys/log",
          sign: "log",
          required: false,
          type: "menu",
          orderNum: 16,
          icon: null,
          roleId: "1",
          showFlag: false,
          childList: []
        }
      ]
    }
  },
  packagingRequest: function (param) {
    return {
      data: param,
      url: this.url,
      method: this.method
    };
  },
  packagingResponse(res) {
    return res;
  }
};
/**
 * @description 退出登录
 */
export const logout = {
  name: "退出登录",
  url: "bridata-auth/oauth/logout",
  method: "get",
  requestDemo: {},
  responseDemo: {
    code: 0, //接口响应码 (1:成功;0:失败)
    message: "退出登录失败", //接口消息
    data: null //接口业务数据
  },
  packagingRequest: function (param) {
    return {
      // data: param,
      url: this.url,
      method: this.method
    };
  },
  packagingResponse(res) {
    return res;
  }
};

/**
 * @description 获取用户session
 */
export const getSession = {
  name: "获取用户session",
  url: "/bridata-system/session",
  method: "get",
  requestDemo: {},
  responseDemo: {
    data: []
  },
  packagingRequest: function (param) {
    return {
      params: param,
      url: this.url,
      method: this.method
    };
  },
  packagingResponse(res) {
    return res;
  }
};
/**
 * @description 获取菜单权限
 */
export const getRoutes = {
  name: "获取菜单权限",
  url: "/bridata-system/menu/routes",
  method: "get",
  requestDemo: {},
  responseDemo: {
    data: []
  },
  packagingRequest: function (param) {
    return {
      params: param,
      url: this.url,
      method: this.method
    };
  },
  packagingResponse(res) {
    return res;
  }
};
